// Storage操作
var getStorage = (type) => {
  return type === 's' ? sessionStorage : localStorage;
};

export var save = (key, value, type = 's') => {
  getStorage(type).setItem(key, value);
};

export var read = (key, type = 's') => {
  return getStorage(type).getItem(key) || '';
};

export var remove = (key, type = 's') => {
  getStorage(type).removeItem(key);
};

export var clear = (type = 's') => {
  getStorage(type).clear();
};